package com.personal.book.service.impl;

import java.util.List;

import com.personal.book.dao.impl.OrdersDaoImpl;
import com.personal.book.entity.Orders;
import com.personal.book.service.OrdersService;
import com.personal.tools.PageData;

/**
 * Orders的实现Service接口的类
 * 
 * @author 姬
 *
 */
public class OrdersServiceImpl implements OrdersService {

	OrdersDaoImpl odi = new OrdersDaoImpl();

	// 生成订单
	@Override
	public boolean AddOrders(Orders order) {
		// TODO Auto-generated method stub
		return odi.AddOrders(order);
	}

	@Override
	public boolean delOrders(int orderId) {
		// TODO Auto-generated method stub
		return odi.delOrders(orderId);
	}
	// 根据用户名查询订单
	@Override
	public PageData<Orders> getOrdersByName(int page, int pageSize, String userName) {
		// TODO Auto-generated method stub
		return odi.getOrdersByName(page, pageSize, userName);
	}

	// 分页 根据下单的日期的区间进行查询
	@Override
	public PageData<Orders> getOrdersByDate(int page, int pageSize, String max, String min) {
		// TODO Auto-generated method stub
		return odi.getOrdersByDate(page, pageSize, max, min);
	}

	// 分页 根据订单总价格的范围进行查询
	@Override
	public PageData<Orders> getOrdersByPrice(int page, int pageSize, double max, double min) {
		// TODO Auto-generated method stub
		return odi.getOrdersByPrice(page, pageSize, max, min);
	}

	// 分页 通过价格进行降序
	@Override
	public PageData<Orders> getOrdersByDesc(int page, int pageSize) {
		// TODO Auto-generated method stub
		return odi.getOrdersByDesc(page, pageSize);
	}

	// 分页 通过价格进行升序
	@Override
	public PageData<Orders> getOrdersByAsc(int page, int pageSize) {
		// TODO Auto-generated method stub
		return odi.getOrdersByAsc(page, pageSize);
	}

	@Override
	public List<Orders> getOrdersById(int orderId) {
		// TODO Auto-generated method stub
		return odi.getOrdersById(orderId);
	}
	
	@Override
	public List<Orders> getOrdersByName(String userName) {
		// TODO Auto-generated method stub
		return odi.getOrdersByName(userName);
	}

}
